package com.blog.study.study6;


import java.util.Base64;

/**
 * Base64编码.
 *
 * @author 张俊强~.
 * @date 2017/11/30-14:16.
 */
public class Base64Code {

    public static void main(String[] args) {

        //Java新特性中的Base64编码与解码
        byte[] b=Base64.getEncoder().encode("中国".getBytes());
        String result=(new String(b));
        System.out.println(result);
        byte[] b1=Base64.getDecoder().decode(result);
        String orgn = new String(b1);
        System.out.println(orgn);
        System.out.println(Runtime.getRuntime().availableProcessors());

    }

}
